﻿<Window 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ui="clr-namespace:Bonobo.Reader.UI"
    xmlns:reader="clr-namespace:Bonobo.Reader"    
    x:Class="Bonobo.Reader.UI.MainWindow"    
    
    Title="Bonobo Reader" 
    Height="600" 
    Width="400"
    Icon="\Resources\MainIcon.ico">

    <Window.Resources>
        <ui:BonoboItemCollection x:Key="Items" />
        <ui:BonoboDataTemplateSelector x:Key="ItemTemplateSelector" />
    </Window.Resources>

    <Window.CommandBindings>
        <CommandBinding Command="Help" 
                        Executed="HelpExecuted" />
        <CommandBinding Command="Close" 
                        Executed="CloseExecuted" />
        <CommandBinding Command="Refresh"
                        Executed="RefreshExecuted" />
        <CommandBinding Command="{x:Static ui:BonoboCommands.MenuCommand}" 
                        Executed="MenuCommandExecuted" />
    </Window.CommandBindings>

    <Window.InputBindings>
        <KeyBinding Command="Help" 
                    Key="F1"/>
        <KeyBinding Command="Refresh" 
                    Key="F5"/>
    </Window.InputBindings>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="25" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <DockPanel Grid.Column="0" 
                   Grid.Row="0"
                   HorizontalAlignment="Stretch"
                   VerticalAlignment="Top"
                   Height="25">
            <Menu>
                <MenuItem Header="File">
                    <MenuItem Header="Exit" 
                                  ToolTip="Exit application" 
                                  Command="Close" />
                </MenuItem>
                <MenuItem Header="Items">
                    <MenuItem Header="Refresh" 
                                  InputGestureText="F5" 
                                  ToolTip="Refresh items" 
                                  Command="Refresh" />
                </MenuItem>
                <MenuItem Header="Providers" Name="menuProviders">                    
                </MenuItem>
                <MenuItem Header="Help">
                    <MenuItem Header="About" 
                                  ToolTip="Show informations about program"
                                  InputGestureText="F1"
                                  Command="Help">
                    </MenuItem>
                </MenuItem>
            </Menu>
        </DockPanel>
        <ListBox Name="lvItems"
                 BorderThickness="0"
                 ItemsSource="{StaticResource Items}" 
                 SelectionMode="Single"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                 ItemTemplateSelector="{StaticResource ItemTemplateSelector}"
                 Grid.Row="1"
                 Grid.Column="0"
                 Padding="10">
        </ListBox>
    </Grid>
</Window>
